package com.benbi.shequapi.service.impl;

import com.benbi.shequapi.mapper.BuildinMapper;
import com.benbi.shequapi.mapper.BuildingMapper;
import com.benbi.shequapi.mapper.CommunityMapper;
import com.benbi.shequapi.mapper.LiveinMapper;
import com.benbi.shequapi.service.LiveinService;
import com.benbi.shequapi.utils.Result;
import com.benbi.shequapi.utils.ResultData;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LiveinImpl implements LiveinService {
    @Resource
    LiveinMapper liveinMapper;
    @Resource
    BuildingMapper buildingMapper;
    @Resource
    BuildinMapper buildinMapper;
    @Resource
    CommunityMapper communityMapper;

    @Override
    public Result getLiveAddrByPid(int pid) {
        ResultData addrResultData = ServiceUtil.getLiveAddrByPid(liveinMapper, buildingMapper, buildinMapper, communityMapper, pid);
        if (!addrResultData.isSuccess()) {return new Result(addrResultData);}
        return addrResultData;
    }
}
